home *** CD-ROM | disk | FTP | other *** search
/ Stone Design / Stone Design.iso / Stone_Friends / Wave / WavesWorld / Source / Libraries / tcl7.4b3 / doc / for.n < prev    next >
Encoding:
Text File  |  1994-12-17  |  1.5 KB  |  45 lines

  1. '\"
  2. '\" Copyright (c) 1993 The Regents of the University of California.
  3. '\" Copyright (c) 1994 Sun Microsystems, Inc.
  4. '\"
  5. '\" See the file "license.terms" for information on usage and redistribution
  6. '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
  7. '\" 
  8. '\" @(#) for.n 1.2 94/12/17 16:17:55
  9. '\" 
  10. .so man.macros
  11. .HS for tcl
  12. .BS
  13. '\" Note:  do not modify the .SH NAME line immediately below!
  14. .SH NAME
  15. for \- ``For'' loop
  16. .SH SYNOPSIS
  17. \fBfor \fIstart test next body\fR
  18. .BE
  19.  
  20. .SH DESCRIPTION
  21. .PP
  22. \fBFor\fR is a looping command, similar in structure to the C
  23. \fBfor\fR statement.  The \fIstart\fR, \fInext\fR, and
  24. \fIbody\fR arguments must be Tcl command strings, and \fItest\fR
  25. is an expression string.
  26. The \fBfor\fR command first invokes the Tcl interpreter to
  27. execute \fIstart\fR.  Then it repeatedly evaluates \fItest\fR as
  28. an expression; if the result is non-zero it invokes the Tcl
  29. interpreter on \fIbody\fR, then invokes the Tcl interpreter on \fInext\fR,
  30. then repeats the loop.  The command terminates when \fItest\fR evaluates
  31. to 0.  If a \fBcontinue\fR command is invoked within \fIbody\fR then
  32. any remaining commands in the current execution of \fIbody\fR are skipped;
  33. processing continues by invoking the Tcl interpreter on \fInext\fR, then
  34. evaluating \fItest\fR, and so on.  If a \fBbreak\fR command is invoked
  35. within \fIbody\fR
  36. or \fInext\fR,
  37. then the \fBfor\fR command will
  38. return immediately.
  39. The operation of \fBbreak\fR and \fBcontinue\fR are similar to the
  40. corresponding statements in C.
  41. \fBFor\fR returns an empty string.
  42.  
  43. .SH KEYWORDS
  44. for, iteration, looping
  45.